#include <cstdio>

int main()
{
    int arr1[5];
    int arr2[5]={0,1,2};  // 未初始化的元素, 默认为零
    int arr3[]={0,1,2,3,4,5,6};
    arr2[3]=4;
    printf("length %d\n",sizeof(arr2)/sizeof(arr2[0]));
    printf("数组地址%p\n",arr1);
    for(int i =0; i<7;i++){
        printf("%d",arr3[i]);
    }
    int lengthArr3 = sizeof(arr3)/sizeof(arr3[0]);
    // 数组逆序
    for(int i = 0; i <lengthArr3; i++){
        // 交换两端的数据
        int temp;
        temp = arr3[i];
        arr3[i] = arr3[lengthArr3-1-i];
        arr3[lengthArr3-1-i] = temp;
        // 如果左端下标和右端下标相遇, 结束循环
        if (i>=lengthArr3-1-i){
            break;
        }
    }
    printf("\n");
    for(int i =0; i<lengthArr3;i++){
        printf("%d",arr3[i]);
    }
    return 0;
}